/*
 * index.java
 *
 * Created on 19 Mart 2008 Çarşamba, 23:03
 */
package mocawa_hsqldb_101_2;

import ch.ubique.inieditor.IniEditor;

import java.io.*;
import java.sql.SQLException;
import java.util.Calendar;
import java.util.Random;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
 *
 * @author  Tevger
 */
public class index extends javax.swing.JFrame implements global.global_variables {

    /** Creates new form index */
    public index() {
        initComponents();
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jLabel8 = new javax.swing.JLabel();
        DIABRFCNFG = new javax.swing.JFrame();
        jLabel10 = new javax.swing.JLabel();
        jLabel11 = new javax.swing.JLabel();
        jLabel12 = new javax.swing.JLabel();
        jLabel13 = new javax.swing.JLabel();
        jLabel14 = new javax.swing.JLabel();
        jLabel15 = new javax.swing.JLabel();
        jLabel16 = new javax.swing.JLabel();
        jLabel17 = new javax.swing.JLabel();
        TSS = new javax.swing.JTextField();
        TST = new javax.swing.JTextField();
        KSS = new javax.swing.JTextField();
        KST = new javax.swing.JTextField();
        KSK = new javax.swing.JTextField();
        BSS = new javax.swing.JTextField();
        BST = new javax.swing.JTextField();
        BSK = new javax.swing.JTextField();
        jLabel18 = new javax.swing.JLabel();
        BSSSK = new javax.swing.JTextField();
        jLabel19 = new javax.swing.JLabel();
        BSSST = new javax.swing.JTextField();
        jLabel20 = new javax.swing.JLabel();
        BSSSS = new javax.swing.JTextField();
        jLabel21 = new javax.swing.JLabel();
        KSSSK = new javax.swing.JTextField();
        jLabel22 = new javax.swing.JLabel();
        KSSST = new javax.swing.JTextField();
        jLabel23 = new javax.swing.JLabel();
        KSSSS = new javax.swing.JTextField();
        jLabel24 = new javax.swing.JLabel();
        TSSST = new javax.swing.JTextField();
        jLabel25 = new javax.swing.JLabel();
        TSSSS = new javax.swing.JTextField();
        BRF_UPDATE = new javax.swing.JButton();
        jLabel26 = new javax.swing.JLabel();
        jLabel27 = new javax.swing.JLabel();
        jLabel28 = new javax.swing.JLabel();
        jLabel30 = new javax.swing.JLabel();
        DIAALERT = new javax.swing.JDialog();
        jPanel3 = new javax.swing.JPanel();
        ALERT = new javax.swing.JLabel();
        DIAALERT_TAMAM = new javax.swing.JButton();
        jLabel32 = new javax.swing.JLabel();
        jPanel1 = new javax.swing.JPanel();
        jPanel2 = new javax.swing.JPanel();
        jLabel1 = new javax.swing.JLabel();
        jLabel2 = new javax.swing.JLabel();
        jLabel3 = new javax.swing.JLabel();
        TFL = new javax.swing.JTextField();
        TFX = new javax.swing.JTextField();
        TFH = new javax.swing.JTextField();
        jSeparator1 = new javax.swing.JSeparator();
        CMD = new javax.swing.JComboBox();
        jLabel4 = new javax.swing.JLabel();
        jLabel5 = new javax.swing.JLabel();
        CMQ = new javax.swing.JComboBox();
        jSeparator2 = new javax.swing.JSeparator();
        jLabel6 = new javax.swing.JLabel();
        TFSE = new javax.swing.JTextField();
        jLabel7 = new javax.swing.JLabel();
        TFFSE = new javax.swing.JTextField();
        jSeparator3 = new javax.swing.JSeparator();
        jLabel9 = new javax.swing.JLabel();
        TFFIYAT = new javax.swing.JTextField();
        jLabel29 = new javax.swing.JLabel();
        TSB = new javax.swing.JTextField();
        jLabel31 = new javax.swing.JLabel();
        BTHESAPLA = new javax.swing.JButton();
        BTBRFCNFG = new javax.swing.JButton();
        comm = new javax.swing.JLabel();
        BT_FORMTEMIZLE = new javax.swing.JButton();
        SONUCU_TEKLIF_LISTESINE_EKLE = new javax.swing.JButton();
        jLabel33 = new javax.swing.JLabel();
        TEKNO = new javax.swing.JTextField();
        BT_EBGIREKRAN_KAPAT = new javax.swing.JButton();

        jLabel8.setText("jLabel8");

        jLabel10.setText("TSS");

        jLabel11.setText("TST");

        jLabel12.setText("KSS");

        jLabel13.setText("BSS");

        jLabel14.setText("KSK");

        jLabel15.setText("KST");

        jLabel16.setText("BST");

        jLabel17.setText("BSK");

        jLabel18.setText("BSSSK");

        jLabel19.setText("BSSST");

        jLabel20.setText("BSSSS");

        jLabel21.setText("KSSSK");

        jLabel22.setText("KSSST");

        jLabel23.setText("KSSSS");

        jLabel24.setText("TSSST");

        jLabel25.setText("TSSSS");

        BRF_UPDATE.setText("BİRİM FİYAT KONFİGÜRASYONU GÜNCELLE");
        BRF_UPDATE.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                BRF_UPDATEMouseClicked(evt);
            }
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                BRF_UPDATEMouseEntered(evt);
            }
        });

        jLabel26.setFont(new java.awt.Font("Tahoma", 1, 11));
        jLabel26.setText("BİRİM FİYAT KONFİGÜRASYONU (YTL/M2)");

        jLabel27.setText("Eğer bu ekrandan önce hesapla butonuna bastıysanız:");

        jLabel28.setText("Hesapların güncellenmesi için tekrar hesapla butonuna basınız.");

        jLabel30.setText("Ondalıklı ifadeler virgülle değil noktayla girilmelidir.");

        javax.swing.GroupLayout DIABRFCNFGLayout = new javax.swing.GroupLayout(DIABRFCNFG.getContentPane());
        DIABRFCNFG.getContentPane().setLayout(DIABRFCNFGLayout);
        DIABRFCNFGLayout.setHorizontalGroup(
            DIABRFCNFGLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(DIABRFCNFGLayout.createSequentialGroup()
                .addGap(23, 23, 23)
                .addGroup(DIABRFCNFGLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel30)
                    .addComponent(jLabel28)
                    .addGroup(DIABRFCNFGLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                        .addComponent(BRF_UPDATE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addGroup(DIABRFCNFGLayout.createSequentialGroup()
                            .addGroup(DIABRFCNFGLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                .addGroup(DIABRFCNFGLayout.createSequentialGroup()
                                    .addComponent(jLabel17)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                    .addComponent(BSK, javax.swing.GroupLayout.PREFERRED_SIZE, 97, javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addGroup(DIABRFCNFGLayout.createSequentialGroup()
                                    .addComponent(jLabel16)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                    .addComponent(BST, javax.swing.GroupLayout.PREFERRED_SIZE, 97, javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addGroup(DIABRFCNFGLayout.createSequentialGroup()
                                    .addComponent(jLabel13)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                    .addComponent(BSS, javax.swing.GroupLayout.PREFERRED_SIZE, 97, javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addGroup(DIABRFCNFGLayout.createSequentialGroup()
                                    .addComponent(jLabel14)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                    .addComponent(KSK, javax.swing.GroupLayout.PREFERRED_SIZE, 97, javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addGroup(DIABRFCNFGLayout.createSequentialGroup()
                                    .addComponent(jLabel15)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                    .addComponent(KST, javax.swing.GroupLayout.PREFERRED_SIZE, 97, javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addGroup(DIABRFCNFGLayout.createSequentialGroup()
                                    .addComponent(jLabel12)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                    .addComponent(KSS, javax.swing.GroupLayout.PREFERRED_SIZE, 97, javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addGroup(DIABRFCNFGLayout.createSequentialGroup()
                                    .addComponent(jLabel11)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                    .addComponent(TST, javax.swing.GroupLayout.PREFERRED_SIZE, 97, javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addGroup(DIABRFCNFGLayout.createSequentialGroup()
                                    .addComponent(jLabel10)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                    .addComponent(TSS, javax.swing.GroupLayout.PREFERRED_SIZE, 97, javax.swing.GroupLayout.PREFERRED_SIZE)))
                            .addGap(33, 33, 33)
                            .addGroup(DIABRFCNFGLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                .addGroup(DIABRFCNFGLayout.createSequentialGroup()
                                    .addComponent(jLabel18)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(BSSSK, javax.swing.GroupLayout.PREFERRED_SIZE, 97, javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addGroup(DIABRFCNFGLayout.createSequentialGroup()
                                    .addComponent(jLabel19)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(BSSST, javax.swing.GroupLayout.PREFERRED_SIZE, 97, javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addGroup(DIABRFCNFGLayout.createSequentialGroup()
                                    .addComponent(jLabel20)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(BSSSS, javax.swing.GroupLayout.PREFERRED_SIZE, 97, javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addGroup(DIABRFCNFGLayout.createSequentialGroup()
                                    .addComponent(jLabel21)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(KSSSK, javax.swing.GroupLayout.PREFERRED_SIZE, 97, javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addGroup(DIABRFCNFGLayout.createSequentialGroup()
                                    .addComponent(jLabel22)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(KSSST, javax.swing.GroupLayout.PREFERRED_SIZE, 97, javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addGroup(DIABRFCNFGLayout.createSequentialGroup()
                                    .addComponent(jLabel23)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(KSSSS, javax.swing.GroupLayout.PREFERRED_SIZE, 97, javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addGroup(DIABRFCNFGLayout.createSequentialGroup()
                                    .addComponent(jLabel24)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(TSSST, javax.swing.GroupLayout.PREFERRED_SIZE, 97, javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addGroup(DIABRFCNFGLayout.createSequentialGroup()
                                    .addComponent(jLabel25)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(TSSSS, javax.swing.GroupLayout.PREFERRED_SIZE, 97, javax.swing.GroupLayout.PREFERRED_SIZE))))
                        .addComponent(jLabel27, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(jLabel26, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
                .addContainerGap(49, Short.MAX_VALUE))
        );
        DIABRFCNFGLayout.setVerticalGroup(
            DIABRFCNFGLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(DIABRFCNFGLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel26)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jLabel30)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(DIABRFCNFGLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(DIABRFCNFGLayout.createSequentialGroup()
                        .addGroup(DIABRFCNFGLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel10)
                            .addComponent(TSS, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(DIABRFCNFGLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel11)
                            .addComponent(TST, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(DIABRFCNFGLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel12)
                            .addComponent(KSS, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(DIABRFCNFGLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel15)
                            .addComponent(KST, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(DIABRFCNFGLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel14)
                            .addComponent(KSK, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(DIABRFCNFGLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel13)
                            .addComponent(BSS, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(DIABRFCNFGLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel16)
                            .addComponent(BST, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(DIABRFCNFGLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel17)
                            .addComponent(BSK, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addGroup(DIABRFCNFGLayout.createSequentialGroup()
                        .addGroup(DIABRFCNFGLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel25)
                            .addComponent(TSSSS, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(DIABRFCNFGLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel24)
                            .addComponent(TSSST, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(DIABRFCNFGLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel23)
                            .addComponent(KSSSS, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(DIABRFCNFGLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel22)
                            .addComponent(KSSST, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(DIABRFCNFGLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel21)
                            .addComponent(KSSSK, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(DIABRFCNFGLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel20)
                            .addComponent(BSSSS, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(DIABRFCNFGLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel19)
                            .addComponent(BSSST, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(DIABRFCNFGLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel18)
                            .addComponent(BSSSK, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))))
                .addGap(18, 18, 18)
                .addComponent(BRF_UPDATE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(jLabel27)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jLabel28))
        );

        DIAALERT.getContentPane().setLayout(new java.awt.FlowLayout());

        jPanel3.setBackground(new java.awt.Color(255, 255, 255));
        jPanel3.setLayout(new java.awt.BorderLayout());

        ALERT.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        ALERT.setText("ALERT MESSAGE");
        jPanel3.add(ALERT, java.awt.BorderLayout.CENTER);

        DIAALERT.getContentPane().add(jPanel3);

        DIAALERT_TAMAM.setText("TAMAM");
        DIAALERT_TAMAM.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                DIAALERT_TAMAMMouseClicked(evt);
            }
        });
        DIAALERT.getContentPane().add(DIAALERT_TAMAM);

        jLabel32.setText("jLabel32");

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setFont(new java.awt.Font("Trebuchet MS", 0, 10));
        setUndecorated(true);
        addWindowListener(new java.awt.event.WindowAdapter() {
            public void windowClosed(java.awt.event.WindowEvent evt) {
                formWindowClosed(evt);
            }
        });
        getContentPane().setLayout(new javax.swing.BoxLayout(getContentPane(), javax.swing.BoxLayout.LINE_AXIS));

        jPanel1.setBackground(new java.awt.Color(255, 255, 255));
        jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Hesaplama Modülü", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Tahoma", 0, 11), new java.awt.Color(255, 153, 51))); // NOI18N
        jPanel1.setOpaque(false);

        jPanel2.setBackground(new java.awt.Color(255, 255, 102));

        jLabel1.setText("Boy (L):");

        jLabel2.setText("En. (x):");

        jLabel3.setText("Yüks. (h):");

        TFL.setPreferredSize(new java.awt.Dimension(7, 20));
        TFL.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyReleased(java.awt.event.KeyEvent evt) {
                TFLKeyReleased(evt);
            }
        });

        TFX.setMinimumSize(new java.awt.Dimension(7, 20));
        TFX.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyReleased(java.awt.event.KeyEvent evt) {
                TFXKeyReleased(evt);
            }
        });

        TFH.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyReleased(java.awt.event.KeyEvent evt) {
                TFHKeyReleased(evt);
            }
        });

        jSeparator1.setOrientation(javax.swing.SwingConstants.VERTICAL);

        CMD.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Seçiniz", "B", "BC", "C" }));
        CMD.addItemListener(new java.awt.event.ItemListener() {
            public void itemStateChanged(java.awt.event.ItemEvent evt) {
                CMDİtemStateChanged(evt);
            }
        });

        jLabel4.setText("Dalga:");

        jLabel5.setText("Kalite:");

        CMQ.addItemListener(new java.awt.event.ItemListener() {
            public void itemStateChanged(java.awt.event.ItemEvent evt) {
                CMQİtemStateChanged(evt);
            }
        });

        jSeparator2.setOrientation(javax.swing.SwingConstants.VERTICAL);

        jLabel6.setText("Safia eni: (mm)");

        TFSE.setEditable(false);

        jLabel7.setText("Fiyatlandırma Safia eni: (mm)");

        TFFSE.setBackground(new java.awt.Color(153, 255, 255));
        TFFSE.setToolTipText("Bu alan kullanıcı tarafından girilir");
        TFFSE.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyReleased(java.awt.event.KeyEvent evt) {
                TFFSEKeyReleased(evt);
            }
        });

        jSeparator3.setOrientation(javax.swing.SwingConstants.VERTICAL);

        jLabel9.setText("FİYAT (YTL/ADET)");

        TFFIYAT.setBackground(new java.awt.Color(255, 204, 204));

        jLabel29.setText("EBATLAR (mm)");

        TSB.setEditable(false);

        jLabel31.setText("Safia boyu:(mm)");

        javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout.setHorizontalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel1)
                            .addComponent(TFL, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel2)
                            .addComponent(TFX, javax.swing.GroupLayout.PREFERRED_SIZE, 46, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel3)
                            .addComponent(TFH, javax.swing.GroupLayout.PREFERRED_SIZE, 53, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jSeparator1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel4)
                            .addComponent(CMD, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(CMQ, javax.swing.GroupLayout.PREFERRED_SIZE, 72, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel5))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jSeparator2, javax.swing.GroupLayout.PREFERRED_SIZE, 22, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(jLabel6, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(TFSE, javax.swing.GroupLayout.PREFERRED_SIZE, 56, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(TFFSE)
                            .addComponent(jLabel7))
                        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanel2Layout.createSequentialGroup()
                                .addGap(16, 16, 16)
                                .addComponent(TSB, javax.swing.GroupLayout.PREFERRED_SIZE, 54, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(jPanel2Layout.createSequentialGroup()
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jLabel31)))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jSeparator3, javax.swing.GroupLayout.PREFERRED_SIZE, 13, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanel2Layout.createSequentialGroup()
                                .addComponent(jLabel9)
                                .addGap(41, 41, 41))
                            .addGroup(jPanel2Layout.createSequentialGroup()
                                .addComponent(TFFIYAT, javax.swing.GroupLayout.DEFAULT_SIZE, 172, Short.MAX_VALUE)
                                .addContainerGap())))
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addComponent(jLabel29, javax.swing.GroupLayout.DEFAULT_SIZE, 273, Short.MAX_VALUE)
                        .addGap(582, 582, 582))))
        );
        jPanel2Layout.setVerticalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addComponent(jLabel29)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jSeparator1, javax.swing.GroupLayout.DEFAULT_SIZE, 57, Short.MAX_VALUE)
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addComponent(jLabel9)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(TFFIYAT, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addComponent(jSeparator3, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 57, Short.MAX_VALUE)
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addGap(20, 20, 20)
                        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(TFH, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(TFX, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(TFL, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(jLabel1)
                        .addComponent(jLabel2)
                        .addComponent(jLabel3))
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel4)
                            .addComponent(jLabel5))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(CMQ, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(CMD)))
                    .addComponent(jSeparator2, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 57, Short.MAX_VALUE)
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel7)
                            .addComponent(jLabel6)
                            .addComponent(jLabel31))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(TFSE, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(TSB, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(TFFSE, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))))
                .addContainerGap())
        );

        BTHESAPLA.setText("HESAPLA");
        BTHESAPLA.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                BTHESAPLAMouseClicked(evt);
            }
        });

        BTBRFCNFG.setText("BİRİM FİYAT KONFİGÜRASYONU");
        BTBRFCNFG.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                BTBRFCNFGMouseClicked(evt);
            }
        });

        comm.setBackground(new java.awt.Color(204, 255, 255));
        comm.setForeground(new java.awt.Color(255, 51, 51));
        comm.setText("Status:");

        BT_FORMTEMIZLE.setText("FORM TEMİZLE");
        BT_FORMTEMIZLE.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                BT_FORMTEMIZLEMouseClicked(evt);
            }
        });

        SONUCU_TEKLIF_LISTESINE_EKLE.setText("SONUCU VARSAYILAN TEKLİF LİSTESİNE EKLE");
        SONUCU_TEKLIF_LISTESINE_EKLE.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                SONUCU_TEKLIF_LISTESINE_EKLEMouseClicked(evt);
            }
        });

        jLabel33.setText("VARSAYILAN TEKLİF NO:");

        TEKNO.setEditable(false);

        BT_EBGIREKRAN_KAPAT.setText("Kapat");
        BT_EBGIREKRAN_KAPAT.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                BT_EBGIREKRAN_KAPATMouseClicked(evt);
            }
        });

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addGap(24, 24, 24)
                        .addComponent(BTHESAPLA)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(BTBRFCNFG)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(BT_FORMTEMIZLE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(SONUCU_TEKLIF_LISTESINE_EKLE))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(comm, javax.swing.GroupLayout.DEFAULT_SIZE, 455, Short.MAX_VALUE)
                        .addGap(336, 336, 336)
                        .addComponent(BT_EBGIREKRAN_KAPAT)
                        .addGap(13, 13, 13))
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(jLabel33)
                        .addGap(18, 18, 18)
                        .addComponent(TEKNO, javax.swing.GroupLayout.PREFERRED_SIZE, 210, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap())
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addGap(29, 29, 29)
                .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addGap(42, 42, 42)
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(BTHESAPLA)
                            .addComponent(BTBRFCNFG)
                            .addComponent(BT_FORMTEMIZLE)
                            .addComponent(SONUCU_TEKLIF_LISTESINE_EKLE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 21, Short.MAX_VALUE)
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel33)
                            .addComponent(TEKNO, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGap(18, 18, 18)
                        .addComponent(comm))
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(BT_EBGIREKRAN_KAPAT)))
                .addContainerGap())
        );

        getContentPane().add(jPanel1);

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void CMDİtemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_CMDİtemStateChanged
      

        if (CMD.getSelectedItem().equals("BC")) {

            CMQ.removeAllItems();
            CMQ.addItem("TSSSS");
            CMQ.addItem("TSSST");
            CMQ.addItem("KSSSS");
            CMQ.addItem("KSSSK");
            CMQ.addItem("BSSSS");
            CMQ.addItem("BSSST");
            CMQ.addItem("BSSSK");




        } else// B VEYA C IKEN
        {

            CMQ.removeAllItems();
            CMQ.addItem("TSS");
            CMQ.addItem("TST");
            CMQ.addItem("KSS");
            CMQ.addItem("KST");
            CMQ.addItem("KSK");
            CMQ.addItem("BSS");
            CMQ.addItem("BST");
            CMQ.addItem("BSK");

        }




    }//GEN-LAST:event_CMDİtemStateChanged

    private void BTBRFCNFGMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_BTBRFCNFGMouseClicked
       birim_fiyat_verilerini_getir();
    }//GEN-LAST:event_BTBRFCNFGMouseClicked
/**
 * 
 * BU METOT BIRIM FIYAT VERILERININ EKRANINI ACAR VE INI DOSYASINDAKI VERILERI EKRANA YAZDIRIR
 */
    
    public void birim_fiyat_verilerini_getir()
            {
        
         try {
            
            //ını yüklemE VE OKUMA
            IniEditor i = new IniEditor();
            i.load("beyin\\birimfiyatlar.ini");
            TSS.setText(i.get("birimfiyat", "TSS"));
            TST.setText(i.get("birimfiyat", "TST"));
            KSS.setText(i.get("birimfiyat", "KSS"));
            KST.setText(i.get("birimfiyat", "KST"));
            KSK.setText(i.get("birimfiyat", "KSK"));
            BSS.setText(i.get("birimfiyat", "BSS"));
            BST.setText(i.get("birimfiyat", "BST"));
            BSK.setText(i.get("birimfiyat", "BSK"));

            TSSSS.setText(i.get("birimfiyat", "TSSSS"));
            TSSST.setText(i.get("birimfiyat", "TSSST"));
            KSSSS.setText(i.get("birimfiyat", "KSSSS"));
            KSSST.setText(i.get("birimfiyat", "KSSST"));
            KSSSK.setText(i.get("birimfiyat", "KSSSK"));
            BSSSS.setText(i.get("birimfiyat", "BSSSS"));
            BSSST.setText(i.get("birimfiyat", "BSSST"));
            BSSSK.setText(i.get("birimfiyat", "BSSSK"));




        } catch (IOException ex) {
            Logger.getLogger(index.class.getName()).log(Level.SEVERE, null, ex);
        }

        //EKRANYARAT   

        DIABRFCNFG.setSize(500, 400);
        DIABRFCNFG.setLocation(333, 333);

        DIABRFCNFG.setVisible(true);

        
        
    }
    /**
     * 
     * BU METOT BIRIM FIYAT EKRANINDAKI TEXTFIELDLERDE YAZAN VERILERI ESKI DOSYA UZERINE YAZARAK GUNCELLER
     */
    
    public void birim_fiyat_verilerini_guncelle()
    {
                try {

            //ını yüklemE VE YAZMA
            IniEditor i = new IniEditor();
            i.load("beyin\\birimfiyatlar.ini");
            i.set("birimfiyat", "TSS", TSS.getText());
            i.set("birimfiyat", "TST", TST.getText());
            i.set("birimfiyat", "KSS", KSS.getText());
            i.set("birimfiyat", "KST", KST.getText());
            i.set("birimfiyat", "KSK", KSK.getText());
            i.set("birimfiyat", "BSS", BSS.getText());
            i.set("birimfiyat", "BST", BST.getText());
            i.set("birimfiyat", "BSK", BSK.getText());

            i.set("birimfiyat", "TSSSS", TSSSS.getText());
            i.set("birimfiyat", "TSSST", TSSST.getText());
            i.set("birimfiyat", "KSSSS", KSSSS.getText());
            i.set("birimfiyat", "KSSST", KSSST.getText());
            i.set("birimfiyat", "KSSSK", KSSSK.getText());
            i.set("birimfiyat", "BSSSS", BSSSS.getText());
            i.set("birimfiyat", "BSSST", BSSST.getText());
            i.set("birimfiyat", "BSSSK", BSSSK.getText());





            i.save("beyin\\birimfiyatlar.ini");
            BRF_UPDATE.setText("GÜNCELLENDİ");



        } catch (IOException ex) {
            Logger.getLogger(index.class.getName()).log(Level.SEVERE, null, ex);
        }


    }
    
   /**
    * 
    * BIRIM FIYAT GUNCELLEME BUTONUNA BASILINCA OLACAKLAR
    * @param evt
    */ 
    private void BRF_UPDATEMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_BRF_UPDATEMouseClicked

birim_fiyat_verilerini_guncelle();



    }//GEN-LAST:event_BRF_UPDATEMouseClicked

    private void BRF_UPDATEMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_BRF_UPDATEMouseEntered
      

        BRF_UPDATE.setText("BİRİM FİYAT KONFİGÜRASYONU GÜNCELLE");
    }//GEN-LAST:event_BRF_UPDATEMouseEntered

    private void BTHESAPLAMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_BTHESAPLAMouseClicked

        fiyathesapla();

    }//GEN-LAST:event_BTHESAPLAMouseClicked

    private void CMQİtemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_CMQİtemStateChanged
       
        SEguncelle();


    }//GEN-LAST:event_CMQİtemStateChanged

    private void TFXKeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_TFXKeyReleased
      
        virgul_engelle(evt);
        SEguncelle();

    }//GEN-LAST:event_TFXKeyReleased

    private void TFHKeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_TFHKeyReleased
        
        virgul_engelle(evt);
        SEguncelle();
    }//GEN-LAST:event_TFHKeyReleased

    private void TFFSEKeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_TFFSEKeyReleased
        
        virgul_engelle(evt);
        try {
            fiyathesapla();
        } catch (Exception e) {
            comm.setText("Lütfen öncelikle ebatları girin");
        }

    }//GEN-LAST:event_TFFSEKeyReleased

    private void BT_FORMTEMIZLEMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_BT_FORMTEMIZLEMouseClicked
       

        TFFIYAT.setText("");
        TFFSE.setText("");
        TFH.setText("");
        TFL.setText("");
        TFX.setText("");
        CMD.setSelectedItem("Seçiniz");
        CMQ.setSelectedItem("");
        TFSE.setText("");
        TSB.setText("");


    }//GEN-LAST:event_BT_FORMTEMIZLEMouseClicked

    private void TFLKeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_TFLKeyReleased
       
        fiyathesapla();
        virgul_engelle(evt);
    }//GEN-LAST:event_TFLKeyReleased
    public void alert(String message) {
        ALERT.setText(message);
        DIAALERT.setSize(500, 150);
        DIAALERT.setLocation(200, 200);
        DIAALERT.setVisible(true);
    }

    private void DIAALERT_TAMAMMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_DIAALERT_TAMAMMouseClicked
      
        DIAALERT.setVisible(false);
       

    }//GEN-LAST:event_DIAALERT_TAMAMMouseClicked
    public String EBSERNO;//ebat seri no. her bir ebatın tekil ifadesi

    public String EBSERNO() {
        String tno = TEKNO.getText();
        Calendar c = Calendar.getInstance();
        String Y = String.valueOf(c.get(Calendar.YEAR));
        String A = String.valueOf(c.get(Calendar.MONTH));
        String G = String.valueOf(c.get(Calendar.DAY_OF_MONTH));
        String S = String.valueOf(c.get(Calendar.HOUR));
        String D = String.valueOf(c.get(Calendar.MINUTE));
        String s = String.valueOf(c.get(Calendar.SECOND));
        EBSERNO = "TK" + tno + "EB" + Y + A + G + S + D + "RND" + S + sayiUret(1000);
        System.out.println("---EBSERNO:" + EBSERNO);
        return EBSERNO;

    }
    Random rastgeleBirSayi = new Random();

    public String sayiUret(int tavan) {
        String sayi = String.valueOf((Math.abs(rastgeleBirSayi.nextInt()) % tavan) + 1);


        return sayi;
    }

    /**
     * 
     * GİRİLEN EBAT BİLGİSİ VARSAYILAN TEKLİF LİSTESİNE EKLENİR.
     */
    
    public String  tno; // hesap modulu ekraninda varsayilan teklifnodur.
    private void SONUCU_TEKLIF_LISTESINE_EKLEMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_SONUCU_TEKLIF_LISTESINE_EKLEMouseClicked
        //ebat kodu olusturma


tno = TEKNO.getText();

        try {
            // TODO add your handling code here:
           
            String boy = TFL.getText();
            String en = TFX.getText();
            String yuk = TFH.getText();
            String dalga = CMD.getSelectedItem().toString();
            String kalite = CMQ.getSelectedItem().toString();
            String safiaeni = TFSE.getText();
            String fiyatsafiaeni = TFFSE.getText();
            String safiaboyu = TSB.getText();
            String birimfiyat = TFFIYAT.getText();
//            db_driver db=new db_driver();
//            Class.forName(db.driver);
            db.baglanti_kur();


            String sqlSorgusu = "INSERT INTO TEKLIFLISTESI (TEKLIFNO, BOY, EN, YUKSEKLIK, DALGA, KALITE, SAFIAENI, FIYATSAFIAENI,SAFIABOYU,BIRIMFIYAT,EBAT_SERI_NO) VALUES (?,?,?,?,?,?,?,?,?,?,?)";
            db.ps = db.c.prepareStatement(sqlSorgusu);
            db.ps.setString(1, tno);
            db.ps.setString(2, boy);
            db.ps.setString(3, en);
            db.ps.setString(4, yuk);
            db.ps.setString(5, dalga);
            db.ps.setString(6, kalite);
            db.ps.setString(7, safiaeni);
            db.ps.setString(8, fiyatsafiaeni);
            db.ps.setString(9, safiaboyu);
            db.ps.setString(10, birimfiyat);
            db.ps.setString(11, EBSERNO());
            db.ps.executeUpdate();
            db.c.close();
            db.baglanti_kapat();
            System.out.println("Ebat bilgisi eklendi");
            alert("Ebat bilgisi eklendi");
          
            
            //TODO ebatlarin otomatikman yenilenmesini saglayacak kod yazilmali


        } catch (Exception ex) {
            System.out.println("Hata:SONUCU_TEKLIF_LISTESINE_EKLEMouseClicked " + ex);
            alert("Hata: " + ex);
        //TODO hata durumunda ozel exception ekrani acacak kodlar buraya yazilacak
//            acilis_hata_ekrani ae=new acilis_hata_ekrani();
//            ae.hatamesajiac(ex);
        }


           




    }//GEN-LAST:event_SONUCU_TEKLIF_LISTESINE_EKLEMouseClicked

    private void formWindowClosed(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_formWindowClosed
        try {

            db.baglanti_kapat();
        } catch (SQLException ex) {
            Logger.getLogger(index.class.getName()).log(Level.SEVERE, null, ex);
        } catch (ClassNotFoundException ex) {
            Logger.getLogger(index.class.getName()).log(Level.SEVERE, null, ex);
        }

    }//GEN-LAST:event_formWindowClosed

    private void BT_EBGIREKRAN_KAPATMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_BT_EBGIREKRAN_KAPATMouseClicked
       
        dispose();
    }//GEN-LAST:event_BT_EBGIREKRAN_KAPATMouseClicked

    public void virgul_engelle(java.awt.event.KeyEvent evt) {
        System.out.println(evt.getKeyCode());
        if (evt.getKeyCode() == 44) {
            alert("Virgül kullanmazsınız,bunun yerine nokta kullanın");
        } else {
        }

    }

    /*
     * SECILEN DALGAYA GORE SAFIA ENI HSAPLAR
     * **KALITE SECILIR SECILMEZ
     * SAFIA ENI OTOMATIKMEN HESAPLANSIN KI KULLANICI FSE SECSIN
     *
     */
    public void SEguncelle() {
        try {

            float H;
            float L;
            float X;
            float SE;
            String DALGA;
            float SB;
            float E; //DALGAYA GÖRE E                  

            System.out.println("----------------------SE HESAP BASI---------------");
            H = Float.parseFloat(TFH.getText());
            System.out.println("H=" + H);
            L = Float.parseFloat(TFL.getText());
            System.out.println("L=" + L);
            X = Float.parseFloat(TFX.getText());
            System.out.println("X=" + X);
            DALGA = CMD.getSelectedItem().toString();
            System.out.println("SECILEN DALGA=" + DALGA);
            if (DALGA.equals("BC")) {
                E = 6;
                System.out.println("ALINAN E=" + E);
            } else {
                E = 4;
                System.out.println("ALINAN E=" + E);
            }
            SE = H + X + E;
            System.out.println(">>SAFIA ENI SE=" + SE);
            SB = 2 * (L + X) + 35;
            System.out.println("SAFIA BOYU SB=" + SB);
            //ekrana yazdırıldı

            //BU DEGER SAFIA ENI ALANINA YAZDIRILIYOR, AYNI ZAMANDA FSE AKANINA YAZDIRILIYOR
            //dalga secilmeden yazdirma islemi yapilmasin
            if (CMD.getSelectedItem().equals("BC") || CMD.getSelectedItem().equals("B") || CMD.getSelectedItem().equals("C")) {
                TFSE.setText(String.valueOf(SE));
                TFFSE.setText(String.valueOf(SE));
                TSB.setText(String.valueOf(SB));
                //ayrica eğer varolan bir fiyat varsaa bunun guncellenmesi için de işlem yapılıyor
                if (Float.parseFloat(TFFIYAT.getText()) > 0) {
                    //bu durumda hesap da guncellenecel
                    fiyathesapla();
                } else {
                }

            } else {
            }
            System.out.println("----------------------SE HESAP SONU---------------");

        } catch (Exception ex) {

            comm.setText("Lütfen verileri eksik girmeyiniz");

        }

    }

    /**
     *BIR KUTUNUN ADET FIYATINI HESAPLAR
     * * hesapla butonu tiklaninca
     * kutu birim adet fiyati hesaplaniyor
     * SAFIA ENI(SE)=H(YUKSEKLIK)+X(EN)+E(DALGANIN B VEYA C ISE 4 BC ISE 6 OLDUGU DEGER) SE FORMULE GIRMEZ SADECE BILGILENDIRME AMACILDIRE
     * FSE: FIYATLAIRMA SAFIA ENI: BU KULLANICININ GIRECEGI DEGER OLUP HESABA GIRER
     * FSA: FIYATLANDIRILACAK SAFIA ALANI
     * SB(SAFIA BOYU)=2*(L+X)+35
     * FSA=FSE*SB
     * Q=KALITE INDEKSI(KONFIGURASYON EKRANINDAKI DEGERLERE GORE SECILEN KALITE FIYAT INDEKSI (CMQ TF DEN ALINIR)
     * ADEDFIYAT: BILGILERI GIRILEN KUTUNUN BIR ADEDININ FIYATI
     * ADEDFIYAT=FSA*Q
     *
     * SONUC KIRMIZI ALANA YAZDIRILIR
     */
    public void fiyathesapla() {


        try {
          
            float H;
            float L;
            float X;
            float SE;
            float FSE;
            float FSA;
            float SB;
            float Q;
            float ADEDFIYAT;
            String DALGA;
            String STRQ; //KALITENIN STRING DEGERI

            float E; //DALGAYA GÖRE E                  

            System.out.println("----------------------HESAP BASI---------------");
            H = Float.parseFloat(TFH.getText());
            System.out.println("H=" + H);
            L = Float.parseFloat(TFL.getText());
            System.out.println("L=" + L);
            X = Float.parseFloat(TFX.getText());
            System.out.println("X=" + X);
            DALGA = CMD.getSelectedItem().toString();
            System.out.println("SECILEN DALGA=" + DALGA);
            if (DALGA.equals("BC")) {
                E = 6;
                System.out.println("ALINAN E=" + E);
            } else {
                E = 4;
                System.out.println("ALINAN E=" + E);
            }
            SE = H + X + E;
            System.out.println(">>SAFIA ENI SE=" + E);
            SB = 2 * (L + X) + 35;
            System.out.println("SAFIA BOYU SB=" + SB);
            TSB.setText(String.valueOf(SB));           //ekrana yazdırıldı

            FSE = Float.parseFloat(TFFSE.getText()); //KULLANICININ GIRECEGI FSE DEGERI

            System.out.println("KULLANICININ GIRDIGI SAFIA ENI, FIYATLANDIRMA SAFIA ENI FSE=" + FSE);
            FSA = SB * FSE;
            System.out.println(">>HESAPLANAN SAFIA ALANI FSA=" + FSA);
            STRQ = CMQ.getSelectedItem().toString();
            System.out.println("SECILI KALITE INDEKSI=" + STRQ);
            //INI DOSYASINDAN BIRIM FIYAT SECILI OLAN KALITE INDEKSI ICIN OKUNUR
            IniEditor i = new IniEditor();
            i.load("beyin\\birimfiyatlar.ini");
            Q = Float.parseFloat(i.get("birimfiyat", STRQ));
            System.out.println("SECILI KALITE INDEKS FIYATI=" + Q);
            //FINAL: MM2 ALANDAN M2'YE CEVIRMEK ICIN BIRMILYONA BOLIYIRUZ
            ADEDFIYAT = FSA * Q / 100000;
            System.out.println("BIR KUTU BIRIM FIYATI=" + ADEDFIYAT);
            System.out.println("----------------------HESAP SONU---------------");
            //ADED FIYATI ILGILI BOSLUGA YAZDIRILIYOR
            TFFIYAT.setText(String.valueOf(ADEDFIYAT));



        } catch (Exception ex) {
            //Logger.getLogger(index.class.getName()).log(Level.SEVERE, null, ex);
            comm.setText("Lütfen tüm değeleri eksiksiz girin");
        }





    }

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {

            public void run() {
                new index().setVisible(true);
            }
        });
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JLabel ALERT;
    private javax.swing.JButton BRF_UPDATE;
    private javax.swing.JTextField BSK;
    private javax.swing.JTextField BSS;
    private javax.swing.JTextField BSSSK;
    private javax.swing.JTextField BSSSS;
    private javax.swing.JTextField BSSST;
    private javax.swing.JTextField BST;
    public javax.swing.JButton BTBRFCNFG;
    private javax.swing.JButton BTHESAPLA;
    private javax.swing.JButton BT_EBGIREKRAN_KAPAT;
    private javax.swing.JButton BT_FORMTEMIZLE;
    private javax.swing.JComboBox CMD;
    private javax.swing.JComboBox CMQ;
    private javax.swing.JDialog DIAALERT;
    private javax.swing.JButton DIAALERT_TAMAM;
    public javax.swing.JFrame DIABRFCNFG;
    private javax.swing.JTextField KSK;
    private javax.swing.JTextField KSS;
    private javax.swing.JTextField KSSSK;
    private javax.swing.JTextField KSSSS;
    private javax.swing.JTextField KSSST;
    private javax.swing.JTextField KST;
    private javax.swing.JButton SONUCU_TEKLIF_LISTESINE_EKLE;
    public javax.swing.JTextField TEKNO;
    private javax.swing.JTextField TFFIYAT;
    private javax.swing.JTextField TFFSE;
    private javax.swing.JTextField TFH;
    private javax.swing.JTextField TFL;
    private javax.swing.JTextField TFSE;
    private javax.swing.JTextField TFX;
    private javax.swing.JTextField TSB;
    private javax.swing.JTextField TSS;
    private javax.swing.JTextField TSSSS;
    private javax.swing.JTextField TSSST;
    private javax.swing.JTextField TST;
    private javax.swing.JLabel comm;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel10;
    private javax.swing.JLabel jLabel11;
    private javax.swing.JLabel jLabel12;
    private javax.swing.JLabel jLabel13;
    private javax.swing.JLabel jLabel14;
    private javax.swing.JLabel jLabel15;
    private javax.swing.JLabel jLabel16;
    private javax.swing.JLabel jLabel17;
    private javax.swing.JLabel jLabel18;
    private javax.swing.JLabel jLabel19;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel20;
    private javax.swing.JLabel jLabel21;
    private javax.swing.JLabel jLabel22;
    private javax.swing.JLabel jLabel23;
    private javax.swing.JLabel jLabel24;
    private javax.swing.JLabel jLabel25;
    private javax.swing.JLabel jLabel26;
    private javax.swing.JLabel jLabel27;
    private javax.swing.JLabel jLabel28;
    private javax.swing.JLabel jLabel29;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel30;
    private javax.swing.JLabel jLabel31;
    private javax.swing.JLabel jLabel32;
    private javax.swing.JLabel jLabel33;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JLabel jLabel9;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JPanel jPanel3;
    private javax.swing.JSeparator jSeparator1;
    private javax.swing.JSeparator jSeparator2;
    private javax.swing.JSeparator jSeparator3;
    // End of variables declaration//GEN-END:variables
}
